package com.study.design.model.behaviorPattern.observer.j2se;

import java.util.Observable;

/**
* @Name: ConcreteSubject
* @Description: 目标对象
* @Author: 李超	lc_jack@foxmail.com
* @CreateDate: 2017-2-15 下午10:21:29 
* @Version: V1.0
 */
public class ConcreteSubject extends Observable {
	
	//目标对象的状态标记
	private int state ;
	
	/**
	* @Name: set
	* @Description: 改变目标对象的状态，并通知所有的观察者
	* @Author: 李超	lc_jack@foxmail.com
	* @Version: V1.0
	* @CreateDate: 2017-2-15 下午10:22:35
	* @Parameters: @param state
	* @Return: void
	 */
	public void set(int state) {
		this.state = state ;
		setChanged() ;
		notifyObservers(state) ;
	}

	public int getState() {
		return state;
	}

	public void setState(int state) {
		this.state = state;
	}
	
}
